<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('services', function (Blueprint $table) {
            $table->comment('服务表');
            $table->id();
            $table->string('title')->comment('标题');
            $table->tinyInteger('status')->default(0)->comment('状态：0待审核,1正常,2下架');
            $table->tinyInteger('type')->default(1)->comment('类型：1预置服务2用户发布');
            $table->unsignedTinyInteger('category_id')->default(0)->comment('分类ID');
            $table->tinyInteger('is_recommended')->default(0)->comment('是否推荐：1是');
            $table->string('cover_image')->nullable()->comment('封面图');
            $table->json('images')->nullable()->comment('图片列表');
            $table->text('content')->nullable()->comment('服务详情');
            $table->decimal('price', 10, 2)->comment('售价');
            $table->integer('sort')->nullable()->comment('排序');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('services');
    }
};
